﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMSSyncData.Model;
using WMSSyncData.Model.WMSModel;
using WMSSyncData.Utils;

namespace WMSSyncData.DAL.SqlDB
{
    public class Tddev110DAL : BaseSqlDBDAL<tddev110>
    {
        public List<tddev110> GetSyncData()
        {

            var sql = string.Format(@"select guid,BillNo AS WMSNO,1 as WMSPO,RelatedBill as orno,RowNo as pono,Storage_SN as qoor,
                                        CenterCode as wdep,BillType as otyp,BillSeries as seri,PartNumber as item,Qty as qord,
                                        1 as host,' ' as mess,getdate() as edte1,getdate() as wdte1,getdate() as wdte2,
                                        getdate() as edte2,0 as REFCNTD,0 AS REFCNTU ,
(case when isnull(Version,'')='' then ' ' else Version end) as revi,
(case when isnull(Remark,'')='' then ' ' else Remark end) as Remark1,
' ' as Remark2,' ' as Remark3,' ' as Remark4,' ' as Remark5 from wms_T_Request where Status='1'");

            var dt = SqlDBHelper.GetDataSet(sql).Tables[0];

            var list = MakeTablePackage(dt);

            return list;
        }


    }
}
